using System;
using DslCrossModelFramework;
using DslCrossModelFramework.Environment;
using EnvDTE;
using Microsoft.VisualStudio.Modeling.Shell;
using Microsoft.VisualStudio.Shell.Interop;

namespace DslCrossModelFramework.VSPackage {
    public class DslIntegrationService : IDslIntegrationService, SDslIntegrationService {
        private static volatile IModelDirectory modelDirectory;
        private static object syncObject = new object();
        public IModelDirectory GetModelDirectory() {
            lock (syncObject) {
            if (modelDirectory == null) {
                    modelDirectory = new ModelDirectory();
                }
            }
            return modelDirectory;
        }

        public void RegisterDefaultEnvironments() {
            DslCrossModelFramework.Environment.EnvironmentConfiguration.RegisterEnvironmentConfiguration(new VisualStudioEnvironmentConfiguration());
        }
    }
}